Function pointer syntax can be hard on the eyes, particularly when one function is used as a parameter to another. Providing and using a
typedef
instead (or a using
in C++) can make code easier to read, and should be preferred.
Noncompliant code example
extern void (*signal(int, void(*)(int)))(int);
Compliant solution
typedef void (*SignalHandler)(int signum);
extern SignalHandler signal(int signum, SignalHandler handler);